/**
 * 
 */
package STUDENTS.PHAMHONGSON.MVC.Eg07142016.Models;

import STUDENTS.PHAMHONGSON.MVC.Eg07142016.Objects.CalculatorObj;

/**
 * @author WindChime
 *
 */
public class CalculatorModel {
	public double CalElement(CalculatorObj obj){
		double dResult = 0;
		switch (obj.getbOpt()) {
			case 0:  dResult = obj.getdNumA() + obj.getdNumB(); break;
			case 1:  dResult = obj.getdNumA() - obj.getdNumB(); break;
			case 2:  dResult = obj.getdNumA() * obj.getdNumB(); break;
			case 3:  dResult = obj.getdNumA() / obj.getdNumB(); break;		
		}
		return dResult;
	}

}
